import 'package:flutter/material.dart';
import '../model/post.dart';

class PostShow extends StatelessWidget {
  final Post post;
  PostShow({
    this.post
  });
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('${post.title}'),
        elevation: 0.0,
      ),
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: <Widget>[
          Image.network(
            '${post.imageUrl}',
            fit: BoxFit.cover
            ),
         Container(
           padding: EdgeInsets.all(10),
           width: double.infinity,
           child: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
             children:<Widget>[
              SizedBox(height:10),
              Text('${post.title}',style: TextStyle(
              fontSize: 40,
              fontWeight:FontWeight.bold,
              color: Colors.red,
            ),
          ),
              SizedBox(height:10),
              Text('${post.author}',style: Theme.of(context).textTheme.subtitle1),
              SizedBox(height:10),
              Text('${post.description}',style: Theme.of(context).textTheme.bodyText1)
             ]
           ),
          ),
        ]
      ),
    );
  }
}